package com.rui.study.algorithm.T_thread_pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2019-03-22 10:02
 **/
public class TestThreadPool {

    public static void test_thread_pool() {

        ExecutorService executorService = Executors.newCachedThreadPool();
        for (int i = 0; i < 10; i++) {
            executorService.execute(()->{
                System.out.println(Thread.currentThread().getName() + ": hello");
            });
        }
        System.out.println("end");
    }

    public static void main(String[] args) {
        test_thread_pool();
        System.out.println("OVER");
    }
}
